Optimal. Leaf size=252 \[ -\frac{2 a b (d \tan (e+f x))^{n+2} \, _2F_1\left (1,\frac{n+2}{2};\frac{n+4}{2};-\tan ^2(e+f x)\right )}{d^2 f (n+2) \left (a^2+b^2\right )^2}+\frac{\left (a^2-b^2\right ) (d \tan (e+f x))^{n+1} \, _2F_1\left (1,\frac{n+1}{2};\frac{n+3}{2};-\tan ^2(e+f x)\right )}{d f (n+1) \left (a^2+b^2\right )^2}+\frac{b^2 \left (a^2 (2-n)-b^2 n\right ) (d \tan (e+f x))^{n+1} \, _2F_1\left (1,n+1;n+2;-\frac{b \tan (e+f x)}{a}\right )}{a^2 d f (n+1) \left (a^2+b^2\right )^2}+\frac{b^2 (d \tan (e+f x))^{n+1}}{a d f \left (a^2+b^2\right ) (a+b \tan (e+f x))} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.53601, antiderivative size = 252, normalized size of antiderivative = 1., number of steps used = 9, number of rules used = 7, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.304, Rules used = {3569, 3653, 3538, 3476, 364, 3634, 64} \[ -\frac{2 a b (d \tan (e+f x))^{n+2} \, _2F_1\left (1,\frac{n+2}{2};\frac{n+4}{2};-\tan ^2(e+f x)\right )}{d^2 f (n+2) \left (a^2+b^2\right )^2}+\frac{\left (a^2-b^2\right ) (d \tan (e+f x))^{n+1} \, _2F_1\left (1,\frac{n+1}{2};\frac{n+3}{2};-\tan ^2(e+f x)\right )}{d f (n+1) \left (a^2+b^2\right )^2}+\frac{b^2 \left (a^2 (2-n)-b^2 n\right ) (d \tan (e+f x))^{n+1} \, _2F_1\left (1,n+1;n+2;-\frac{b \tan (e+f x)}{a}\right )}{a^2 d f (n+1) \left (a^2+b^2\right )^2}+\frac{b^2 (d \tan (e+f x))^{n+1}}{a d f \left (a^2+b^2\right ) (a+b \tan (e+f x))} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3569
Rule 3653
Rule 3538
Rule 3476
Rule 364
Rule 3634
Rule 64
Rubi steps
\begin{align*} \int \frac{(d \tan (e+f x))^n}{(a+b \tan (e+f x))^2} \, dx &=\frac{b^2 (d \tan (e+f x))^{1+n}}{a \left (a^2+b^2\right ) d f (a+b \tan (e+f x))}+\frac{\int \frac{(d \tan (e+f x))^n \left (d \left (a^2-b^2 n\right )-a b d \tan (e+f x)-b^2 d n \tan ^2(e+f x)\right )}{a+b \tan (e+f x)} \, dx}{a \left (a^2+b^2\right ) d}\\ &=\frac{b^2 (d \tan (e+f x))^{1+n}}{a \left (a^2+b^2\right ) d f (a+b \tan (e+f x))}+\frac{\int (d \tan (e+f x))^n \left (a \left (a^2-b^2\right ) d-2 a^2 b d \tan (e+f x)\right ) \, dx}{a \left (a^2+b^2\right )^2 d}+\frac{\left (b^2 \left (a^2 (2-n)-b^2 n\right )\right ) \int \frac{(d \tan (e+f x))^n \left (1+\tan ^2(e+f x)\right )}{a+b \tan (e+f x)} \, dx}{a \left (a^2+b^2\right )^2}\\ &=\frac{b^2 (d \tan (e+f x))^{1+n}}{a \left (a^2+b^2\right ) d f (a+b \tan (e+f x))}+\frac{\left (a^2-b^2\right ) \int (d \tan (e+f x))^n \, dx}{\left (a^2+b^2\right )^2}-\frac{(2 a b) \int (d \tan (e+f x))^{1+n} \, dx}{\left (a^2+b^2\right )^2 d}+\frac{\left (b^2 \left (a^2 (2-n)-b^2 n\right )\right ) \operatorname{Subst}\left (\int \frac{(d x)^n}{a+b x} \, dx,x,\tan (e+f x)\right )}{a \left (a^2+b^2\right )^2 f}\\ &=\frac{b^2 \left (a^2 (2-n)-b^2 n\right ) \, _2F_1\left (1,1+n;2+n;-\frac{b \tan (e+f x)}{a}\right ) (d \tan (e+f x))^{1+n}}{a^2 \left (a^2+b^2\right )^2 d f (1+n)}+\frac{b^2 (d \tan (e+f x))^{1+n}}{a \left (a^2+b^2\right ) d f (a+b \tan (e+f x))}-\frac{(2 a b) \operatorname{Subst}\left (\int \frac{x^{1+n}}{d^2+x^2} \, dx,x,d \tan (e+f x)\right )}{\left (a^2+b^2\right )^2 f}+\frac{\left (\left (a^2-b^2\right ) d\right ) \operatorname{Subst}\left (\int \frac{x^n}{d^2+x^2} \, dx,x,d \tan (e+f x)\right )}{\left (a^2+b^2\right )^2 f}\\ &=\frac{\left (a^2-b^2\right ) \, _2F_1\left (1,\frac{1+n}{2};\frac{3+n}{2};-\tan ^2(e+f x)\right ) (d \tan (e+f x))^{1+n}}{\left (a^2+b^2\right )^2 d f (1+n)}+\frac{b^2 \left (a^2 (2-n)-b^2 n\right ) \, _2F_1\left (1,1+n;2+n;-\frac{b \tan (e+f x)}{a}\right ) (d \tan (e+f x))^{1+n}}{a^2 \left (a^2+b^2\right )^2 d f (1+n)}-\frac{2 a b \, _2F_1\left (1,\frac{2+n}{2};\frac{4+n}{2};-\tan ^2(e+f x)\right ) (d \tan (e+f x))^{2+n}}{\left (a^2+b^2\right )^2 d^2 f (2+n)}+\frac{b^2 (d \tan (e+f x))^{1+n}}{a \left (a^2+b^2\right ) d f (a+b \tan (e+f x))}\\ \end{align*}
Mathematica [A] time = 2.26879, size = 198, normalized size = 0.79 \[ \frac{\tan (e+f x) (d \tan (e+f x))^n \left (\frac{a \left (\frac{\left (a^2-b^2\right ) \, _2F_1\left (1,\frac{n+1}{2};\frac{n+3}{2};-\tan ^2(e+f x)\right )}{n+1}-\frac{2 a b \tan (e+f x) \, _2F_1\left (1,\frac{n+2}{2};\frac{n+4}{2};-\tan ^2(e+f x)\right )}{n+2}\right )}{a^2+b^2}-\frac{b^2 \left (a^2 (n-2)+b^2 n\right ) \, _2F_1\left (1,n+1;n+2;-\frac{b \tan (e+f x)}{a}\right )}{a (n+1) \left (a^2+b^2\right )}+\frac{b^2}{a+b \tan (e+f x)}\right )}{a f \left (a^2+b^2\right )} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F] time = 0.288, size = 0, normalized size = 0. \begin{align*} \int{\frac{ \left ( d\tan \left ( fx+e \right ) \right ) ^{n}}{ \left ( a+b\tan \left ( fx+e \right ) \right ) ^{2}}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\left (d \tan \left (f x + e\right )\right )^{n}}{{\left (b \tan \left (f x + e\right ) + a\right )}^{2}}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F] time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (\frac{\left (d \tan \left (f x + e\right )\right )^{n}}{b^{2} \tan \left (f x + e\right )^{2} + 2 \, a b \tan \left (f x + e\right ) + a^{2}}, x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\left (d \tan{\left (e + f x \right )}\right )^{n}}{\left (a + b \tan{\left (e + f x \right )}\right )^{2}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\left (d \tan \left (f x + e\right )\right )^{n}}{{\left (b \tan \left (f x + e\right ) + a\right )}^{2}}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]